﻿using Compass.Wasm.Shared.Purchases;
using Compass.Wasm.Shared;

namespace Compass.Wpf.ApiServices.Purchases;
public interface INavInvReportClassService:IBaseService<NavInvReportClassDto>
{
    Task<ApiResponse<NavInvReportClassDto>> GetSingleByMonthAsync(DateTime month);
}
public class NavInvReportClassService:BaseService<NavInvReportClassDto>,INavInvReportClassService
{
    #region ctor
    private readonly HttpRestClient _client;
    private const string ServiceName = "NavInvReportClass";
    public NavInvReportClassService(HttpRestClient client) : base(client, ServiceName)
    {
        _client = client;
    } 
    #endregion

    #region 扩展查询
    public async Task<ApiResponse<NavInvReportClassDto>> GetSingleByMonthAsync(DateTime month)
    {
        var request = new BaseRequest
        {
            Method = RestSharp.Method.Get,
            Route = $"api/{ServiceName}/Month?month={month}"
        };
        return await _client.ExecuteAsync<NavInvReportClassDto>(request);
    } 
    #endregion
}